package com.lplb.gateway.config.result;

import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 *   异常常量类
 *
 * @author ws
 * @mail 1720696548@qq.com
 * @date 2020/2/9 0009 11:16
 * @return
 */

@Getter
@NoArgsConstructor
public enum ResultType {
    //========================业务异常=====================-=====
    IS_NO_LOGON_FAILURE(10000000, "登录失效"),
    IS_NO_TOKEN(10000001, "没有 token"),
    IS_NO_TOKEN_INVALID(10000002, "没有权限访问"),
    IS_NO_PARAM(10000003, "存在非法参数"),
    IS_NO_SENTINEL_MAX(10000004, "QBS已到达阀值,请稍后重试"),
    IS_NO_AUTH(10000005, "获取权限错误"),
    IS_NO_CLIENT_TYPE(10000005, "管理端请添加Header参数[CLIENT_TYPE=producer],用户端请添加Header参数[CLIENT_TYPE=consumer]"),


    //========================请求相关异常=========================
    OK(200, "OK"),
    BAD_REQUEST(400, "Bad Request"),
    UNAUTHORIZED(401, "Unauthorized"),
    PAYMENT_REQUIRED(402, "Payment Required"),
    FORBIDDEN(403, "Forbidden"),
    NOT_FOUND(404, "找不到该请求"),
    INTERNAL_SERVER_ERROR(500, "系统异常"),
    ;


    private Integer code;
    private String msg;

    ResultType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
